<?php

class ProductNotOriginalsModel extends Models
{
    protected $tableName='product_not_originals';

    public function getProducts($id)
    {
        $result=array();
        if($products=$this->findAllByAttributes(array('product_id'=>$id))){
            $model=$this->model->load('productModel');

            foreach($products as $product){
                if($tmpRes=$model->getProducts(array('product_id'=>$product['not_original_id']))){
                    foreach($tmpRes as $res){
                        $result[]=$res;
                    }
                }
            }
        }

        return $result ? $result : false;
    }

    public function getTableName(){
        return $this->tableName;
    }
}